<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>管理员列表-WeAdmin Frame型后台管理系统-WeAdmin 1.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../css/font.css">
    <link rel="stylesheet" href="../../css/weadmin.css">
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="weadmin-nav">
			<span class="layui-breadcrumb">
        <a href="">首页</a>
				<a href="">参数管理</a>
        <a>

          <cite>参数列表</cite></a>
      </span>
    <a class="layui-btn layui-btn-sm" style="line-height:1.6em;margin-top:3px;float:right"
       href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="weadmin-body">
    <table class="layui-table" id="demo" lay-filter="test">
    </table>
</div>
<script src="../../lib/layui/layui.js" charset="utf-8"></script>
<script src="../../js/eleDel.js" type="text/javascript" charset="utf-8"></script>
</body>
<script>
    layui.use(['jquery', 'admin', 'table'], function () {
        var $ = layui.jquery,
            table = layui.table;
        table.render({
            elem: '#demo'
            , height: 200
            , url: '/sysParamList' //数据接口
            , page: false //开启分页
            , width: 500
            , cols: [[ //表头
                {field: 'paramName', title: '参数名称', width: "50%"}
                , {field: 'paramValue', title: '参数值', width: "50%", edit: "text"}
            ]]
        });
        table.on('edit(test)', function (obj) { //注：edit是固定事件名，test是table原始容器的属性 lay-filter="对应的值"
            $.ajax({
                url: '/editParam',
                data: obj.data,
                method: "post",
                success: function () {
                    layer.msg("修改成功!");
                }
            });
        });
    })
</script>

</html>